import request from '@/utils/request/index'
import type {
  loginForm,
  userInfoResponseData,
  loginResponseData,
  logoutResponseData
} from './type'
enum API {
  LOGIN_URL = '/admin/acl/index/login',
  URSERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout'
}
// import type { AxiosResponse } from 'axios'

// 登录
export const reqLogin = (data: loginForm) =>
  request.post<loginResponseData>(API.LOGIN_URL, data)
// request.post<response.data数据类型, response类型,config.data数据类型>
// 用户信息
export const reqUserInfo = () => request.get<userInfoResponseData>(API.URSERINFO_URL)

export const reqLogout = () => request.post<logoutResponseData>(API.LOGOUT_URL)
